/*
 * ============================================================================
 * Copyright Notice!
 * ----------------------------------------------------------------------------
 * This file contains proprietary and confidential information belonging to the
 * group of people involvled in developing this project.  Reproduction, disclosure 
 * or use without specific written authorization from project stake holders is 
 * prohibited. Please refer the readme.txt in project installation folder for more
 * specific contacts
 *
 * All rights reserved.
 * ============================================================================
 */
package edu.uwm.universitydb.service.project;

import java.util.List;

import edu.uwm.universitydb.framework.exception.DataAccessException;
import edu.uwm.universitydb.model.Professor;
import edu.uwm.universitydb.model.Project;
import edu.uwm.universitydb.model.Student;
import edu.uwm.universitydb.model.User;

/**
 * <code>ProjectService</type>
 * Service layer contract for project related operations
 * 
 * @author Shyam Nair
 */
public interface ProjectService
{

    /**
     * <code>createProject(...)</code> creates a new project and associates it with a professor
     * 
     * @param project
     * @param manager
     * @return
     */
    boolean createProject(final Project project, final Professor manager) throws DataAccessException;

    /**
     * <code>updateProject(...)</code>  
     * 
     * @param project
     * @param manager
     * @return
     */
    boolean updateProject(final Project project) throws DataAccessException;

    
    /**
     * <code>associateProjectWithManager(...)</code> associates a projects with professor
     * 
     * @param manager
     * @return
     */
    boolean associateProjectWithManager(final String managerSSN, final Integer projectNum);

    /**
     * <code>getProjectManager(...)</code> get Manager
     * 
     * @param pno
     * @return
     */
    Professor getProjectManager(final Integer pno);

    
    /**
     * <code>searchProjectByManager(...)</code> search all the projects associated with a professor
     * results will be sorted by project number
     * 
     * @param profSSN
     * @return
     */
    List<Project> searchProjectByManager(final String profSSN);

    

    /**
     * <code>searchProjectByManager(...)</code> search all the projects associated with a professor
     * results will be sorted by project number
     * 
     * @param profSSN
     * @return
     */
    Project searchProjectByID(final Integer id);

    /**
     * <code>searchProjectByManager(...)</code> search all the projects associated with a professor
     * results will be sorted by sort order
     * 
     * @param profSSN
     * @param sortOrderEnum
     * @return
     */
    List<Project> searchProjectByManager(final String profSSN,
        final ProjectSortOrderEnum sortOrderEnum);

    /**
     * <code>getAllProjects(...)</code> returns all the projects in the system order by project
     * number
     * 
     * @return
     */
    List<Project> getAllProjects();

    /**
     * <code>getAllProjects(...)</code> returns all the projects in system sorted in the sort order
     * passed by
     * 
     * @param sortOrder
     * @return
     */
    List<Project> getAllProjects(final ProjectSortOrderEnum sortOrder);

    /**
     * <code>getProjectsByRole(...)</code> returns all the projects that could be maintained by the
     * user based on user role
     * results will be sorted based on project number
     * 
     * @param user
     * @param userSSN
     * @return
     */
    List<Project> getProjectsByUser(final User user, final String userSSN);

    /**
     * <code>getProjectsByRole(...)</code> returns all the projects that could be maintained by the
     * user based on user role
     * results will be sorted based on the sort order
     * 
     * @param user
     * @param userSSN
     * @param sortOrder
     * @return
     */
    List<Project> getProjectsByUser(final User user, final String userSSN, final ProjectSortOrderEnum sortOrder);

    /**
     * <code>removeProject(...)</code> deletes the project and managed by information from system
     * 
     * @return
     */
    boolean removeProject(final Integer projectNumber);
    
    /**
     * <code>getProjectCoinvestigators(...)</code>
     * 
     * @param projectNumber
     * @return
     */
    List<Professor> getProjectCoinvestigators(final Integer projectNumber);
    
    /**
     * <code>getProjectStudents(...)</code>
     * 
     * @param projectNumber
     * @return
     */
    List<Student> getProjectStudents(final Integer projectNumber);
    
    /**
     * 
     * <code>removeStudentFromProject(...)</code>
     * 
     * @param studentSSN
     * @param projectNum
     * @return
     */
    public boolean removeStudentFromProject(final String studentSSN, final Integer projectNum);
    
    /**
     * <code>associateProjectWithStudent(...)</code>
     * 
     * @param studentSSN
     * @param projectNum
     * @return
     */
    public boolean associateProjectWithStudent(final String studentSSN, final Integer projectNum);
    
    /**
     * <code>associateCoInvestigator(...)</code>
     * 
     * @param managerSSN
     * @param projectNum
     * @return
     */
    public boolean associateCoInvestigator(final String managerSSN, final Integer projectNum);
    
    /**
     * <code>removeCoInvestigator(...)</code>
     * 
     * @param managerSSN
     * @param projectNum
     * @return
     */
    public boolean removeCoInvestigator(final String managerSSN, final Integer projectNum);
    
    

}
/*
 * ============================================================================
 * Change History
 * ----------------------------------------------------------------------------
 * Apr 19, 2014   Shyam Nair
 * File created
 * ----------------------------------------------------------------------------
 * Apr 23, 2014 Shyam Nair
 * Added methods - associateCoInvestigator, removeCoInvestigator
 * ----------------------------------------------------------------------------
 */